// eslint-disable-next-line
import { UserLayout, BasicLayout, PageView } from '@/layouts'
// import { bxAnaalyse } from '@/core/icons'

export const asyncRouterMap = [
  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    //  meta: { title: '首页' },
    redirect: '/testDesign',
    children: [
      // dashboard
      // 用户管理
      {
        path: '/user',
        name: 'user',
        redirect: '/user/UserList',
        component: PageView,
        meta: { title: '用户管理', keepAlive: true, icon: 'solution', permission: ['userList'] },
        children: [
          {
            path: '/UserList',
            name: 'UserList',
            component: () => import('@/views/user/UserList'),
            meta: { title: '用户列表', keepAlive: true, permission: ['userList'] }
          }
        ]
      },
      // 试验管理
      {
        path: '/testDesign',
        name: 'testDesign',
        redirect: '/testDesign/TestDesign',
        component: PageView,
        meta: {
          title: '试验管理',
          keepAlive: true,
          icon: 'project',
          permission: ['experimentList', 'experimentData']
        },
        children: [
          {
            path: '/testDesign',
            name: 'TestDesign',
            component: () => import('@/views/test/TestDesign'),
            meta: { title: '试验列表', keepAlive: true, permission: ['experimentList'] }
          },
          {
            path: '/testData',
            name: 'TestData',
            component: () => import('@/views/test/TestData'),
            meta: { title: '试验数据', keepAlive: true, permission: ['experimentData'] }
          }
        ]
      },

      // 消息管理
      {
        path: '/message',
        name: 'message',
        redirect: '/message/workplace',
        component: PageView,
        meta: {
          title: '消息管理',
          keepAlive: true,
          icon: 'mail',
          permission: ['userSuggest', 'messageNotification']
        },
        children: [
          {
            path: '/message/customerFeedback',
            name: 'CustomerFeedback',
            component: () => import('@/views/message/CustomerFeedback'),
            meta: { title: '用户反馈', keepAlive: true, permission: ['userSuggest'] }
          },
          {
            path: '/message/notification',
            name: 'Notification',
            component: () => import('@/views/message/Notification'),
            meta: { title: '消息通知', keepAlive: true, permission: ['messageNotification'] }
          }
        ]
      },

      // 账号管理
      {
        path: '/account',
        name: 'account',
        redirect: '/account/accountList',
        component: PageView,
        meta: {
          title: '账号管理',
          keepAlive: true,
          icon: 'compass',
          permission: ['accountList', 'roleSetting', 'permissionsAllot']
        },
        children: [
          {
            path: '/account/accountList',
            name: 'AccountList',
            component: () => import('@/views/account/AccountList'),
            meta: { title: '账号列表', keepAlive: true, permission: ['accountList'] }
          },
          {
            path: '/account/roleSetting',
            name: 'RoleSetting',
            component: () => import('@/views/account/RoleSetting'),
            meta: { title: '角色设置', keepAlive: true, permission: ['roleSetting'] }
          },
          {
            path: '/account/authorityAllocation',
            name: 'AuthorityAllocation',
            component: () => import('@/views/account/AuthorityAllocation'),
            meta: { title: '权限分配', keepAlive: true, permission: ['permissionsAllot'] }
          }
        ]
      },

      // 系统管理
      {
        path: '/system',
        name: 'system',
        redirect: '/system/operationLog',
        component: PageView,
        meta: {
          title: '系统管理',
          keepAlive: true,
          icon: 'bar-chart',
          permission: ['operatLog', 'systemSetting']
        },
        children: [
          {
            path: '/system/operationLog',
            name: 'OperationLog',
            component: () => import('@/views/system/OperationLog'),
            meta: { title: '操作日志', keepAlive: true, permission: ['operatLog'] }
          },
          {
            path: '/system/SystemSettings',
            name: 'SystemSettings',
            component: () => import('@/views/system/SystemSettings'),
            meta: { title: '系统设置', keepAlive: true, permission: ['systemSetting'] }
          }
        ]
      }
    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/hospitalLogin',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        //  component: () => import(/* webpackChunkName: "user" */ '@/views/logon/HospitalLogin')
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
      },
      {
        path: 'resetPassword',
        name: 'resetPassword',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/ResetPassword')
      },
      {
        path: 'forgetPassword',
        name: 'forgetPassword',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/ForgetPassword')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
      },
      {
        // 药厂
        path: 'factoryLogin',
        name: 'factoryLogin',
        component: () => import(/* webpackChunkName: "user" */ '@/views/logon/FactoryLogin')
      },
      {
        // 医院
        path: 'hospitalLogin',
        name: 'hospitalLogin',
        component: () => import(/* webpackChunkName: "user" */ '@/views/logon/HospitalLogin')
      },
      {
        // 管理端
        path: 'managementLogin',
        name: 'managementLogin',
        component: () => import(/* webpackChunkName: "user" */ '@/views/logon/ManagementLogin')
      }
    ]
  },
  {
    path: '/404',
    name: '404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  },
  {
    path: '/Help',
    name: 'Help',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/other/Help')
  },
  {
    path: '/Tutorial',
    name: 'Tutorial',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/other/Tutorial')
  },
  {
    path: '/UserPrivacyAgreement',
    name: 'UserPrivacyAgreement',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/other/UserPrivacyAgreement')
  }
]
